import { useState,Suspense } from 'react'
import React from 'react'
import { createBrowserRouter,RouterProvider} from 'react-router-dom'
let List1=React.lazy(()=>import('./component/List'))
//http://localhost:3000/
// function a(props) {
//     let token=JSON.parse(localStorage.getItem('token'))
//     if (token) {
//       return props.children
//     } else {
//       useNavigate('/list')
//     }
//   }
export default function App() {
let data = [{path:'/list',element:<List1></List1>} ,{ path: '/', element: <Navigate to='/list'></Navigate> },{path:'*',element:<>404</>}]
 return <>
       <RouterProvider router={createBrowserRouter(data,{basename:'/page'})}></RouterProvider>
    
      

    
</>
}
